package com.ptu.service.impl;

import com.ptu.entity.ExpImage;
import com.ptu.mapper.ExpImageMapper;
import com.ptu.service.ExpImageService;
import com.ptu.util.DBUtil;

import java.util.List;

/**
 */
public class ExpImageServiceImpl implements ExpImageService {

    // 添加图片
    @Override
    public int addImage(ExpImage expImage) {
        ExpImageMapper mapper = DBUtil.getSqlSession().getMapper(ExpImageMapper.class);
        int insert = mapper.insertImage(expImage);
        DBUtil.closeAll();
        return insert;
    }

    // 查询图片
    @Override
    public List<ExpImage> findImage(int expid) {
        ExpImageMapper mapper = DBUtil.getSqlSession().getMapper(ExpImageMapper.class);
        List<ExpImage> images = mapper.selectImage(expid);
        DBUtil.closeAll();
        return images;
    }
}
